/**
 * “商品管理”相关接口
 */
import request from '@/utils/request'

export default {

  //listInfo.vue start
  getGoodsDataList(params1, params2, page, size){
    /** 分页获取商品数据 **/
    const data = {
      shopGoods: params1,
      status: params2.status,
      goodsSn: params2.goodsSn,
      goodsName: params2.goodsName,
      warnNumber: params2.warnNumber,
      startTime: params2.startTime,
      endTime: params2.endTime,
    }
    return request({
      url: 'shopGoods/listByPage?page='+page+'&size='+size,
      method: 'post',
      data
    })
  },
  //listInfo.vue end

  //addGoods.vue start
  saveGoods(goodInfo, imgInfos){
    const data = goodInfo
    data.imgInfos = imgInfos;
    return request({
      url: 'shopGoods/addInfo',
      method: 'post',
      data
    })
  },
  //addGoods.vue end
  /** comment.vue--开始 **/
  getCommentInfo(params, page, size){
    const data = params;
    return request({
      url: 'shopGoodsComment/checkByPage?page='+page+'&size='+size,
      method: 'post',
      data
    })
  },
  updateCommentInfo(params){
    const data = params;
    return request({
      url: 'shopGoodsComment/data/updateById',
      method: 'post',
      data
    })
  }
  /** comment.vue--结束 **/
}
